//
//  HYFiltrateTableView.m
//  TJHYHardwareProduct
//
//  Created by Kendama on 2018/1/23.
//  Copyright © 2018年 Kendama. All rights reserved.
//

#import "HYFiltrateTableView.h"
@interface HYFiltrateTableView()

@end

@implementation HYFiltrateTableView



#pragma mark -- 懒加载
- (UITableView *)tableView
{
    if(!_tableView)
    {
        UIView *superView = self;
        _tableView = [[UITableView alloc]init];
        [superView addSubview:_tableView];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.scrollEnabled = NO;
    }
    return _tableView;
}
- (UIButton *)cancelButton
{
    if(!_cancelButton)
    {
        UIView *superView = self;
        _cancelButton = [[UIButton alloc]init];
        [superView addSubview:_cancelButton];
        [_cancelButton setTitle:@"取消" forState:UIControlStateNormal];
        [_cancelButton setTitleColor:rgba(74,74,74,1) forState:UIControlStateNormal];
        [_cancelButton.titleLabel setFont:fontWithSize(15)];
        _cancelButton.layer.borderColor = rgba(155,155,155,1).CGColor;
        _cancelButton.layer.borderWidth = 0.5;
    }
    return _cancelButton;
}
- (UIButton *)commitButton
{
    if(!_commitButton)
    {
        UIView *superView = self;
        _commitButton = [[UIButton alloc]init];
        [superView addSubview:_commitButton];
        [_commitButton setTitle:@"确定" forState:UIControlStateNormal];
        [_commitButton setTitleColor:rgba(63,147,232,1) forState:UIControlStateNormal];
        [_commitButton.titleLabel setFont:fontWithSize(15)];
        _commitButton.layer.borderColor = rgba(155,155,155,1).CGColor;
        _commitButton.layer.borderWidth = 0.5;
    }
    return _commitButton;
}



- (void)masLayoutSubview
{
    __weak UIView *superView = self;

    
    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(superView.mas_top).with.offset(px1920Height(150));
        make.right.left.mas_equalTo(superView);
        make.height.mas_equalTo(px1920Height(1050));
    }];
    
    UIView *lineView = ({
        lineView = [[UIView alloc]init];
        [superView addSubview:lineView];
        lineView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1];
        [lineView mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(superView.mas_top).with.offset(px1920Height(130));
            make.right.left.mas_equalTo(_tableView);
            make.height.mas_equalTo(1);
        }];
        lineView;
    });
    
    [self.cancelButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_tableView.mas_bottom);
        make.left.bottom.mas_equalTo(superView);
        make.right.mas_equalTo(superView.mas_centerX);
    }];
    
    [self.commitButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_tableView.mas_bottom);
        make.right.bottom.mas_equalTo(superView);
        make.left.mas_equalTo(superView.mas_centerX);
    }];
}


@end
